import 'package:flutter_test/flutter_test.dart';
import 'package:device_verify/device_verify.dart';
import 'package:device_verify/device_verify_platform_interface.dart';
import 'package:device_verify/device_verify_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockDeviceVerifyPlatform
    with MockPlatformInterfaceMixin
    implements DeviceVerifyPlatform {

  @override
  Future<String?> getDeviceToken() => Future.value('42');
}

void main() {
  final DeviceVerifyPlatform initialPlatform = DeviceVerifyPlatform.instance;

  test('$MethodChannelDeviceVerify is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelDeviceVerify>());
  });

  test('getDeviceToken', () async {
    DeviceVerify deviceVerifyPlugin = DeviceVerify();
    MockDeviceVerifyPlatform fakePlatform = MockDeviceVerifyPlatform();
    DeviceVerifyPlatform.instance = fakePlatform;

    expect(await deviceVerifyPlugin.getDeviceToken(), '42');
  });
}
